package my.test;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class AutoGatherThread implements Runnable {

    private AutoTask autoTask;
    private SimpleDateFormat yyyy_MM_dd;

    public AutoGatherThread(AutoTask autoTask, SimpleDateFormat asd) {
        this.autoTask = autoTask;
        this.yyyy_MM_dd = asd;
    }

    @Override
    public void run() {

//        boolean flag = autoTask.addSet("111");
//        if (flag) {
//            System.out.println(11);
//        }

        Calendar calendar = Calendar.getInstance();
        // 当天之后一天的数据(已支付，订单状态有效，日期)
        calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + 0);
        calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY));


        Calendar calendar2 = Calendar.getInstance();
        SimpleDateFormat asd = new SimpleDateFormat( "yyyy-MM-dd");
        calendar2.set(Calendar.DAY_OF_MONTH, calendar2.get(Calendar.DAY_OF_MONTH) - 30);
        yyyy_MM_dd.format(calendar2.getTime());

        String ss=yyyy_MM_dd.format(calendar.getTime());
        if(!"2021-07-01".equals(ss)){
            System.out.println(ss);
        }

//        System.out.println("1:"+yyyy_MM_dd.format(calendar.getTime())+": 2"+yyyy_MM_dd.format(calendar2.getTime()));

    }
}
